import con from 'public/req_api'

export default {
    handover_header: ({ commit }, item) => {
        commit('tab_header', item)
    },
    update_menuActive: ({ commit }, item) => {
        commit('update_menuIndex', item)
    },
    update_blockID: (context, item) => {
        if (context.state.classBlock_ID)
            if (context.state.classBlock_ID !== item.Id)
                context.state.article_list = [];

        context.commit('classBlocks_ID', item)

    },
    //更新版块统计数据
    updateStatistics_block: ({ commit }, item) => {
        commit('Statistics_block', item)
    },
    //更新article id值
    updateArticle_id: ({ commit }, item) => {
        commit('update_ArticleID', item)
        con.updateReadNum({ ThemeId: item }).then((data) => {})
    },
    updatePagination: ({ commit }, item) => {
        commit('update_pagination', item)
    },
    updateFooter_satate: (context, item) => {
        context.state.footer_none = item
    },
    getPlace: (context, item) => {
        con.getPlace(item).then((res) => {
            if (item)
                context.state.province_city.city = res
            else
                context.state.province_city.province = res
        })
    },
    submitRegister: (context, item) => {
        item[0].Province = item[1];
    },
    postLogin: (context, item) => {
        con.postLogin(item).then((data) => {
            if (data.code == 0 || data.code == 200)
                context.commit('update_Loginstatus_menu', true)
        })
    }
}